package com.xindz.cn.mvptest.components.main.view;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * @name LeanCloudTwo
 * @class name：com.xindz.cn.leancloudtwo.adapter
 * @class describe
 * @anthor XINDZ
 * @time 2017/10/24 10:30
 * @change
 * @chang time
 * @class describe
 */
public class MainViewPagerAdapter extends FragmentPagerAdapter {
    private List<Fragment> mList = new ArrayList<>();
    private String[] titles;

    public MainViewPagerAdapter(FragmentManager fm, String[] titles, List<Fragment> mList) {
        super(fm);
        this.mList = mList;
        this.titles = titles;
    }

    @Override
    public Fragment getItem(int position) {
        return mList.get(position);
    }

    @Override
    public int getCount() {
        return mList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
